Image synthesis apparatus and image synthesis method

ABSTRACT

Drawing processing uses a main Z-buffer in which is stored depth information that expresses distance from a viewpoint, corresponding to each of pixels on a display screen. The main Z-buffer is divided into M×N regions, each formed of K×L pixels. A ZR-buffer stores a minimum value ZMINR and a maximum value ZMAXR of the depth information for the pixels within each of the regions. The minimum value of depth information for a polygon is ZMIN, and the maximum value thereof is ZMAX. The process of referencing depth information stored in the main Z-buffer and the process of drawing the polygon are omitted when ZMIN≧ZMAXR, and the process of drawing is performed for the polygon without referencing depth information stored in the main Z-buffer when ZMAX≦ZMINR.

TECHNICAL FIELD

This invention relates to an image synthesis apparatus and an imagesynthesis method that use a Z-buffer for drawing processing.

BACKGROUND OF ART

Various types of image synthesis apparatus for synthesizingthree-dimentional (3D) images are known in the art. An example of theconfiguration thereof is shown in FIG. 11. This prior-art examplecomprises a control section 510, a virtual 3D space computation section520, an image supply section 530, and an image synthesis section 540.The virtual 3D space computation section 520 performs computations forcreating a virtual 3D space on the basis of control information that isinput from the control section 510. The image supply section 530performs computations such as coordinate transformation and clipping tocreate an image as seen from any predetermined viewpoint within the thuscreated virtual 3D space. In this case, each of the display objectsconfiguring this virtual 3D space is configured by polygons, and theimage supply section 530 outputs information (such as vertexcoordinates) for each of these polygons to the image synthesis section540. The image synthesis section 540 performs processing for drawing allthe dots (pixels) within each polygon, from the thus input polygoninformation, making it possible to show an image on a display 512.

During this type of drawing processing, if a polygon is found to overlapanother polygon, it is usually necessary to remove the portion thereofthat is further away from the viewpoint (the hidden surface) and displayonly that portion that is closer to the viewer. A known prior-art methodof removing such hidden surfaces is called the Z-buffer method. Anexample of this Z-buffer method was disclosed in Jyouhou-Shori(Information Processing) Vol. 24, No. 4 (published by the InformationProcessing Society, Apr. 15, 1983).

In the prior-art image synthesis apparatus that is intended to performthis hidden surface removal by the Z-buffer method, the image synthesissection 540 comprises a drawing processing section 542 and a Z-buffer544. In this case, the Z-buffer 544 is a memory containing storage areascorresponding to each of the pixels on the screen, and each storage areacontains a Z-value which is depth information that expresses distancefrom a viewpoint.

The Z-buffer method will now be described with reference to FIGS. 12Aand 12B. In FIG. 12A, polygons P and Q of 3D objects 300 and 301 areperspectively transformed on a screen 306. The drawing processing isperformed with the aid of the Z-buffer 544, in the sequence shown inFIG. 12B. A maximum value M (which is usually an infinite value) of theZ-values has been written into the Z-buffer 544 as an initial value.When the polygon P is drawn, for example, a decision is made as towhether or not the Z-value of each pixel of the polygon P is less thanthe Z-value of the corresponding pixel stored in the Z-buffer 544. If itis determined to be smaller, that pixel is subjected to drawingprocessing by the drawing processing section 542 and the Z-value of thatpixel in the Z-buffer 544 is modified. More specifically, all of thecorresponding Z-values are updated from M to P1 to P12.

Similarly, when the polygon Q is drawn, the Z-buffer 544 is referencedfor each of the pixels to be drawn, and the drawing processing andupdating of the Z-buffer 544 are performed in sequence in the samemanner as described above. More specifically, the values P7, P8, P11,and P12 are updated to Q1, Q2; Q5, and Q6, and the M values for theremaining part of the polygon Q are updated to Q3, Q4, Q7, and Q8 toQ12. In other words, since the polygon Q is closer than the polygon P inthis particular case, the overlapping portion thereof overwrites theZ-values to those of the polygon Q. The drawing processing section 542uses the above method for the drawing processing of each polygon, andthus obtained image information is output through a frame buffer 546 andpalette circuit 548 to the display 512.

This type of image synthesis apparatus is usually required to performits processing in real-time, making it necessary to update the imagedata for one screen image (or, in some cases, two screen images) onceevery field, which could be once every 1/60 second. Thus this imagesynthesis apparatus is required to provide high-speed processing and theimage quality will deteriorate if it cannot maintain this high speed.The part of this apparatus that is particularly important in regulatingthe speed of this image processing is the part thereof that performs thedrawing processing for the pixels.

However, the prior-art Z-buffer method forces the apparatus to gothrough the entire procedure of referencing the Z-buffer 544, comparingthe Z-value with the Z-value stored in the Z-buffer, and writing theresult of this comparison back into the Z-buffer for each of the pixelsduring the drawing processing. This Z-buffer usually has a huge capacityand is provided as external memory for the drawing processing device.Therefore, time is required for accessing this memory, and thus drawingprocessing that has to access this external memory for each of thepixels will increase the overall processing time. In consequence, alimit has to be placed on the number of polygons that can be processedwithin one field, obstructing the provision of a high-quality image.

Since the Z-buffer for this prior-art Z-buffer method is externalmemory, physical limitations such as the numbers of output pins of thedrawing processing device make it difficult to connect a plurality ofdrawing processing devices to a single Z-buffer to implement parallelprocessing.

A method of drawing processing in which cache memory is used totemporarily store part of contents of the Z-buffer is disclosed inJapanese Patent Application Laid-Open No. 3-255589. However, the drawingprocessing provided by this method still has to be performed while thedepth information stored in the cache memory is referenced for each ofthe pixels, and thus the problem of a too-long drawing processing timeinevitably remains.

Other methods of increasing speed are known, such as using page modewhen DRAM is used as the Z-buffer. However, it has not been possible toup until now to enable the prior-art Z-buffer method to make full use ofthe characteristics of these methods of increasing the processing speed.

This invention was devised in order to solve the above describedtechnical problems in the prior art. An objective thereof is to improveon the prior-art Z-buffer method by providing a ZR-buffer in addition tothe Z-buffer (main Z-buffer), in order to increase the processing speedof drawing.

Another objective of this invention is to improve on the Z-buffer methodto implement a drawing processing method that is suitable for parallelprocessing.

A further objective of this invention is to improve on the Z-buffermethod to allow the application of techniques such as using cache memoryor page mode.

DISCLOSURE OF INVENTION

In order to solve the above described problems in the prior art, anaspect of this invention relates to an image synthesis apparatus forreferencing depth information from a main Z-buffer which stores depthinformation that expresses distance from a viewpoint for each of pixelson a display screen and for drawing a display object configured bypolygons, comprising:

a ZR-buffer for storing a minimum value ZMINR and a maximum value ZMAXRof depth information for the pixels within each region of said mainZ-buffer, where the main Z-buffer is divided into M×N regions eachformed of K×L pixels; and

drawing processing means for omitting a process of referencing depthinformation stored within the main Z-buffer and a process of drawing apolygon when ZMIN≧ZMAXR or ZMIN >ZMAXR, where a minimum value or a valueless than the minimum value of depth information for pixels within thepolygon is ZMIN and a maximum value or a value greater than the maximumvalue thereof is ZMAX, and for performing the process of drawing thepolygon without referencing depth information stored within the mainZ-buffer when ZMAX≦ZMINR or ZMAX<ZMINR.

In accordance with this aspect of the invention, the processes ofreferencing depth information from the main Z-buffer and drawing thepolygons are omitted if ZMI≧ZMAXR. The process of drawing the polygonsis performed without referencing depth information in the main Z-bufferif ZMAX≦ZMINR. Therefore, it is not necessary in these cases to accessthe large-capacity main Z-buffer, which helps to increase the processingspeed. This tendency towards faster speeds is further increased if themain Z-buffer is provided as external memory and the ZR-buffer isprovided as internal memory. If the size of a polygon is of the sameorder as the size of one region (block), the number of times referenceprocessing is performed can be reduced to something like 2/(K×L) timesthat with the ordinary Z-buffer method. This invention also makes itpossible to provide the ZR-buffer with a large number of ports, toenable parallel drawing processing.

Note that it is preferable with this aspect of the invention that aminimum value or a value less than the minimum value of depthinformation of pixels within a part of a polygon which is subdividedalong border lines of the regions is set to be ZMIN, and a maximum valueor a value greater than the maximum value thereof is set to be ZMAX.

Another aspect of this invention relates to an image synthesis apparatusfor referencing depth information from a main Z-buffer which storesdepth information that expresses distance from a viewpoint for each ofpixels on a display screen and for performing drawing processing,comprising:

a ZR-buffer for storing a minimum value ZMINR and a maximum value ZMAXRof depth information for the pixels within each region of the mainZ-buffer, where the main Z-buffer is divided into M×N regions eachformed of K×L pixels; and

drawing processing means for omitting a process of referencing depthinformation stored within the main Z-buffer and a process of drawing apixel when ZPIX≧ZMAXR or ZPIX>ZMAXR, where depth information for thepixel to be drawn is ZPIX, and for performing the process of drawing thepixel without referencing depth information stored within the mainZ-buffer when ZPIX≦ZMINR or ZPIX<ZMINR.

With this aspect of the invention, the processes of referencing depthinformation from the main Z-buffer and drawing the pixels are omitted ifZPIX≧ZMAXR. The process of drawing the pixels is performed withoutreferencing depth information in the main Z-buffer if ZPIX≦ZMINR.Therefore, it is not necessary in these cases to access thelarge-capacity main Z-buffer, which helps to increase the processingspeed. This tendency towards faster speeds is further increased if themain Z-buffer is provided as external memory and the ZR-buffer isprovided as internal memory.

In yet another aspect of this invention, the apparatus further comprisesa ZC-buffer for storing depth information for at least one of theregions of the main Z-buffer; wherein:

when depth information to be referenced is already stored in theZC-buffer, the drawing processing means performs the process of drawingby referencing depth information stored in the ZC-buffer, withoutreferencing depth information stored in the main Z-buffer.

With this aspect of the invention, depth information for at least oneregion (block) is stored in the ZC-buffer which acts as a cache memory.If the depth information to be referenced is already stored in theZC-buffer, so that there is no need to reference the main Z-buffer, thedrawing processing can be performed by referencing the small-capacityZC-buffer. This helps to increase the processing speed. This tendencytowards faster speeds is further increased if the main Z-buffer isprovided as external memory and the ZC-buffer is provided as internalmemory. In the same manner as with the ZR-buffer, a large number ofports can be attached to the ZC-buffer to enable parallel drawingprocessing. This configuration of the invention, in which depthinformation corresponding to at least one region in the ZR-buffer isstored in the ZC-buffer, has more advantages than a simple combinationwith memory having a cache function.

In a still further aspect of this invention, the main Z-buffer isconfigured of memory wherein a row address changes in synchronizationwith a column address strobe (CAS) signal and a column address changesin synchronization with a row address strobe (RAS) signal; and

depth information for at least one region is stored in the memory asdata at one row address.

With this aspect of the invention, the main Z-buffer is configured ofmemory that has a page mode function, so that the depth information forat least one region can be stored at a single row address in memory. Thedepth information can be referenced by controlling the CAS signal tochange the column address. This aspect of the invention helps increasethe speed of the processing by enabling the use of page mode, which is amethod of accelerating memory access. This configuration of theinvention, in which depth information corresponding to at least oneregion in the ZR-buffer is stored as data at a single row address in themain Z-buffer and a method such as page mode is used to increase speeds,has more advantages than a simple combination with memory having a pagemode function.

Note that this invention can also be applied to a case in which depthinformation is set in such a manner that it decreases with increasingdistance from the viewpoint, in which case the drawing processing meansomits the process of referencing depth information stored in the mainZ-buffer and the process of drawing when ZMAX≦ZMINR or ZMAX<ZMINR, orwhen ZPIX≦ZMINR or ZPIX<ZMINR, and performs the process of drawingwithout referencing depth information stored in the main Z-buffer whenZMIN≧ZMAXR or ZMIN>ZMAXR, or when ZPIX≧ZMAXR or ZPIX>ZMAXR.

BRIEF DESCRIPTION OF DRAWINGS

FIG. 1 is a diagram illustrative of the principle of this invention;

FIGS. 2A to 2C show the relationships between ZMIN, ZMAX, ZMINR, andZMAXR;

FIG. 3 is a block diagram of a first embodiment of this invention;

FIG. 4 is a block diagram showing details of the image synthesis sectionof the first embodiment of this invention;

FIG. 5 is a view illustrating the 3D computation performed by the firstembodiment;

FIG. 6 is a view illustrating how the minimum and maximum values of theZ-value of a polygon are determined;

FIG. 7 shows an example of a configuration in which the ZR-buffer has alarge number of ports, enabling parallel processing;

FIG. 8 is a block diagram of a second embodiment of this invention;

FIG. 9A to FIG. 9D are diagrams illustrative of a third embodiment ofthis invention;

FIGS. 10A to 10C show the relationships between ZMIN, ZMAX, ZMINR, andZMAXR when depth information decreases with increasing distance from theviewpoint;

FIG. 11 is a block diagram of an example of a prior-art configuration;and

FIGS. 12A and 12B are diagrams illustrative of the Z-buffer method.

BEST MODE FOR CARRYING OUT THE INVENTION

Preferred embodiments of this invention will be described below withreference to the accompanying drawings.

1. Principles of the Invention

The principle of this invention will first be described. With thisinvention, a ZR-buffer is provided in addition to an ordinary Z-buffer(hereinafter called the "main Z-buffer") for storing Z-values thatconstitute depth information. The main Z-buffer in accordance with thisinvention is divided into M×N regions, where each region (block)consists of K×L pixels, as shown in FIG. 1. A minimum value and amaximum value of the Z-values within one region are stored in theZR-buffer at a storage area corresponding to that region. In otherwords, the ZR-buffer has M×N storage areas, and a minimum value ZMINRand a maximum value ZMAXR of the Z-values of each region are stored in acorresponding storage area therein.

The description now turns to the drawing processing performed with theprior-art Z-buffer method. First of all, a Z-value (Z coordinate) ZP iscomputed for each of the pixels within a polygon. This value of ZP isthen compared with a corresponding Z-value ZB in the main Z-buffer. IfZP is less than or equal to ZB, color and other information stored in aframe buffer and the Z-value stored in the main Z-buffer are updated forthat pixel. It should be noted that the description below is based onthe premise that Z-values are set to become smaller closer to theviewpoint. Of course, the generality of the principle of this inventionis not invalidated by Z-values' that are set to become greater closer tothe viewpoint.

In this invention, even if there is only one pixel in a region (a regionas shown in FIG. 1), the following comparisons are performed. In otherwords, assume that a value supposed to be the minimum Z-value of apolygon is ZMIN, a value supposed to be the maximum Z-value of thepolygon is ZMAX, the minimum Z-value in that region is ZMINR, and themaximum Z-value thereof is ZMAXR. In this case, the supposed minimumZ-value and the supposed maximum Z-value of a polygon need notnecessarily be the actual minimum value ZMINT and actual maximum valueZMAXT of the Z-values of the polygon, so long as ZMIN≦ZMINT andZMAX>ZMAXT. ZMINR and ZMAXR are the values that are currently stored inthe ZR-buffer.

In accordance with this invention, ZMIN is compared with ZMAXR and ZMAXis compared with ZMINR. These comparisons may result in any one of thefollowing three conditions:

(1) When ZMIN≧ZMAXR (or ZMIN>ZMAXR);

(2) When ZMAX≦ZMINR (or ZMAX<ZMINR);

(3) When neither condition (1) nor (2) is applicable.

Condition (1) means that the Z-values of all of the pixels within thepolygon are equal to or greater than the maximum Z-value in that region,as shown in FIG. 2A. Therefore, it is determined that drawing processingis not necessary for any of the pixels within the polygon. In this case,the process of referencing the Z-values in the main Z-buffer (readingthe Z-values and using them for comparison) and the process of drawingthe polygon on the basis of the reference results are omitted.

Condition (2) means that the Z-values of all of the pixels within thepolygon are equal to or less than the minimum Z-value in that region, asshown in FIG. 2B. Therefore, it is determined that drawing processing isnecessary for all of the pixels within the polygon. In this case, thepolygon is subjected to drawing processing without referencing theZ-values in the main Z-buffer. The Z-values in the main Z-buffer and theminimum and maximum Z-values in the ZR-buffer are then updated for allof the pixels within the polygon.

Condition (3) is shown in FIG. 2C. In this case, the Z-values in themain Z-buffer are referenced and the drawing processing is performed onthe basis of the reference results, in the same manner as in theordinary Z-buffer method. The Z-values in the main Z-buffer and theminimum and maximum Z-values in the ZR-buffer are then updated for thoseof the pixels that were subjected to the drawing processing.

Since the ZR-buffer stores only minimum and maximum values for eachregion, it can be configured of a small-capacity memory. Thus theZR-buffer can be incorporated within the device (IC) that performs thereferencing and other processing. As a result, if the ZR-buffer isprovided with a large number of input/output ports that can be connectedto reference processing means, it becomes possible to execute the abovedescribed reference processing in parallel. This will help increase theprocessing speed.

Note that the above description concerned drawing processing that isperformed for each polygon. However, it should be obvious that thepresent invention is not limited thereto, and it can equally well beapplied to other types of drawing processing such as one in which ascan-line algorithm is used for drawing individual pixels, irrespectiveof polygons. If the Z-value (depth information) of a pixel in such acase is assumed to be ZPIX, ZPIX is compared with ZMAXR and then withZMINR. These comparisons may result in any one of the following threeconditions:

(4) When ZPIX≧ZMAXR (or ZPIX>ZMAXR);

(5) When ZPIX≦ZMINR (or ZPIX<ZMINR);

(6) When neither condition (4) nor (5) is applicable.

With condition (4), it is determined that drawing processing is notnecessary for that pixel and thus the processes of referencing theZ-value in the main Z-buffer and drawing the polygon on the basis of thereference results are omitted.

With condition (5), it is determined that drawing processing isnecessary for that pixel and thus the pixel is subjected to drawingprocessing without referencing the Z-value in the main Z-buffer. TheZ-value in the main Z-buffer and the minimum and maximum values in theZR-buffer are then updated for that pixel.

With condition (6), the Z-value in the main Z-buffer is referenced andthe drawing processing is performed on the basis of the referenceresult, in the same manner as in the ordinary Z-buffer method. TheZ-value in the main Z-buffer and the minimum and maximum values in theZR-buffer are then updated for that pixel.

When each polygon is processed, the ZR-buffer is referenced only once ifcondition (1) is applicable, and thus the drawing processing for all ofthe pixels within the polygon can be omitted. This means that theprocessing speed can be greatly increased. In contrast, the processingspeed cannot be increased to such an extent if each pixel is processed.Even when each pixel is processed, however, there is no need toreference the main Z-buffer, which is implemented as a large-capacityexternal memory, and thus the processing speed can be increased by thatfactor, in comparison with the prior-art Z-buffer method.

The description now concerns the amount of increase drawing processingspeed achieved by this invention.

With the prior-art Z-buffer method, the process of referencing a Z-value(reading and comparison processing) must be performed for each of thepixels that are to be drawn. Therefore, if it is assumed that a shape tobe drawn (such as a polygon) is of substantially the same size as oneregion (K×L pixels), it is necessary to repeat the reference processingK×L times. In contrast, only two references to the ZR-buffer need beprocessed with the configuration of this invention if condition (1) or(2) (or (4) or (5)) is applicable. For example, if both K and L areequal to 16, K×L=256 references are necessary with the prior-artZ-buffer, but this invention reduces the quantity of processing by2/(K×L)=1/128. If condition (3) (or (6)) is applicable, the processingspeed is the same as that with the prior-art Z-buffer, but this speedcan be increased by combination with a suitable accelerator method. Twoof the methods that can be considered therefor are:

(a) A method of increasing speed by storing part of the depthinformation from the main Z-buffer (the depth information for at leastone region) in a high-speed cache memory (hereinafter called ZC-buffer);

(b) A method of increasing speed by storing the depth information for atleast one region as data of a single row address in a main Z-bufferconfigured of DRAM or the like, and using high-speed page mode of DRAMor the like.

The actual increase in speed that can be expected in practice variesaccording to the values of K, L, M, and N, and the drawing situation.The states of each of conditions (1) and (2) (or (4) and (5)) can beexpected to produce huge increases in speed, but the state of condition(3) (or (6)) cannot be expected to produce much of an increase in speed.In such a case, the methods (a) and (b) could be used to increase speed.

2. First Embodiment

Block diagrams of the configuration of a first embodiment of thisinvention are shown in FIGS. 3 and 4. This first embodiment comprises acontrol section 12, a virtual 3D space computation section 100, an imagesupply section 210, an image synthesis section 230, and a display 10.The image synthesis section 230 comprises a drawing processing section232, a ZR-buffer 234, a main Z-buffer 236, a frame buffer 238, and apalette circuit 240, as shown in FIG. 4.

If this embodiment of the present invention is applied to a racing-cargame, for example, the control section 12 comprises controls such as asteering wheel and accelerator pedal for operating the racing car, andcontrol information is input to the system through these controls.

The virtual 3D space computation section 100 performs computations forsetting details such as the position and orientation of a plurality ofdisplay objects within the virtual 3D space, such as racing cars, thetrack, and buildings. These computations are based on data such ascontrol information from the control section 12, a games program storedin a processing section 102, and map information that has been set andstored beforehand.

The image supply section 210 performs various 3D computations inaccordance with the position and orientation information of the displayobjects that is set by the virtual 3D space computation section 100 andobject image information that is read out from an object imageinformation storage section 212. First of all, computations areperformed for objects 300, 333, and 334 that depict elements such as aracing car and the track, to place the polygons that configure theseobjects in a virtual 3D space expressed in a world coordinate system(absolute coordinate system) (XW, YW, ZW), as shown in FIG. 5. Thecoordinates of the polygons configuring each of these objects are thentransformed by a coordinate transforming section 214 into viewpointcoordinates (Xv, Yv, Zv) referenced to the viewpoint of a player 302 orthe like. Clipping is then performed by a clipping section 216, followedby perspective transformation by a perspective transforming section 218into screen coordinate system (XS, YS).

Processing for drawing all of the pixels within each polygon isperformed by the image synthesis section 230 of FIG. 4 from polygoninformation (information such as the vertex coordinates, vertex texturecoordinates, and vertex brightness information of that polygon) andattribute information (information that is common within the polygon)obtained by the image supply section 210. This drawing processing isdone by a drawing processing section 232 that comprises a pixel drawingsection 250 and a drawing judgement section 252. Data such as colorinformation and brightness information from the drawing processingsection 232 is stored in the frame buffer 238, and is output to thedisplay 10 through the palette circuit 240. Note that, if a texturemapping method is employed, it will be necessary to provide a separatetexture information storage means either between the drawing processingsection 232 and the frame buffer 238 or between the frame buffer 238 andthe palette circuit 240.

The operation of this embodiment will now be described. First of all,data such as polygon information from the image supply section 210 isinput simultaneously to both the pixel drawing section 250 and thedrawing judgement section 252. On the basis of this polygon information,the pixel drawing section 250 determines which pixels are to be drawn,outputs the Z-values of these pixels and X- and Y-coordinates thatexpress the location of each of these pixels to the drawing judgementsection 252, and requests referencing (read-out and comparison). At thispoint, the drawing judgement section 252 has already determined which ofthe ZR-buffer 234 or the main Z-buffer 236 is required, on the basis ofthe polygon information that is input from the image supply section 210.This means that the reference result has already been prepared to bereturned to the pixel drawing section 250, to correspond to thereference request from the pixel drawing section 250. In other words,the drawing judgement section 252 had already obtained ZMIN and ZMAX,read ZMINR and ZMAXR from the ZR-buffer 234, and compared ZMIN withZMAXR and ZMAX with ZMINR, at the stage at which the polygon informationwas input. Note that, in this case, the values of ZMIN and ZMAX could beused as the minimum and maximum Z-values of the polygon 402, ignoringthe positional relationship between the polygon 402 and a block region400, as shown in FIG. 6. Alternatively, the positional relationshipbetween the polygon 402 and the block region 400 could be considered andthe values of ZMIN' and ZMAX' of the part of the polygon 402 that issubdivided along the border lines of the block region 400 could be usedinstead.

If it has been determined by the process of referencing the ZR-buffer234 that it is necessary to reference Z-values in the main Z-buffer 236,the drawing judgement section 252 will have already read the Z-valuesfrom the main Z-buffer 236 at this point.

The above procedure need only output Z-values and X- and Y-coordinatesto the drawing judgement section 252 and issue a reference request; itis not necessary for an awareness of whether or not the referenceprocessing of the drawing judgement section 252 has ended. Whencomparison of the Z-values has already been enabled by the drawingjudgement section 252, in other words, when it is determined byreferencing the ZR-buffer 234 that drawing processing is not necessary,and when the necessary Z-values have been read out of the main Z-buffer236, the pixel drawing section 250 can immediately obtain the referenceresults. This enables the writing of image information to the framebuffer 238, making it possible to increase the processing speed.

If, on the other hand, comparison of the Z-values is not yet enabled atthe drawing judgement section 252, the drawing judgement section 252makes the pixel drawing section 250 wait. This does slow down theprocessing, but it guarantees accurate operation.

Note that it is not absolutely necessary for polygon information to beinput to the drawing judgement section 252, but ensuring that polygoninformation has already been input when a reference request is inputwill increase the speed at which the reference result is returned. Notealso that the configuration of FIG. 4, in which the pixel drawingsection 250 and the drawing judgement section 252 are separate, has anadvantage in that there is no need to modify the configuration of thepixel drawing section 250 if the factors such as the capacities of theZR-buffer 234 and the main Z-buffer 236 or the access timing shouldchange.

Since the main Z-buffer 236 of this embodiment must have a largecapacity, it is provided as external memory outside the deviceconfigured of the drawing processing section 232 and other components.The ZR-buffer 234, on the other hand, need only have a small capacity soit can be incorporated within the device. Thus the ZR-buffer 234 can beaccessed rapidly and, since it is not necessary to access the mainZ-buffer 236 in all cases, the processing can be made much faster thanthat with the prior-art Z-buffer method. If the ZR-buffer 234 can beincorporated within the device, there would be none of the abovedescribed physical limitations on the number of pins, and thus a largenumber of input/output ports can be provided for the ZR-buffer 234,enabling a configuration in which drawing processing sections 232-1 to232-4 are connected to these ports, as shown in FIG. 7. This makes itpossible for drawing processing sections to operate in parallel, whichin itself enables an increase in speed.

3. Second Embodiment

A black diagram of a second embodiment of this invention is shown inFIG. 8. This embodiment differs from the first embodiment in that it isfurther provided with a ZC-buffer 237 that acts as cache memory. ThisZC-buffer 237 is sufficient to contain at least one region (block) ofdepth information, but preferably a plurality of regions of depthinformation, from the main Z-buffer 236. When the above condition (3)(or (6)) applies, in other words when it is necessary to reference depthinformation stored in the main Z-buffer 236, the drawing judgementsection 252 first references the ZC-buffer 237. If the depth informationto be referenced is in the ZC-buffer 237, that depth information is readfrom the ZC-buffer 237; if the depth information to be referenced is notin the ZC-buffer 237, the main Z-buffer 236 is accessed for the firsttime.

Since the ZC-buffer 237 need have only a small capacity, it can beincorporated into the device performing the drawing and otherprocessing. Thus access to the ZC-buffer 237 can be made faster thanaccess to the main Z-buffer 236, making it possible to suppress any dropin the processing speed when condition (3) (or (6)) applies. Since theZC-buffer 237 can be incorporated within the device, the ZC-buffer 237can be provided with a large number of ports in the same manner as thatshown in FIG. 7, and thus the process of referencing the ZC-buffer 237can be done in parallel by connecting the plurality of drawingprocessing sections 232-1 to 232-4 thereto.

The depth information for at least one region is stored in the ZC-buffer237. Therefore, if it has been determined that condition (3) (or (6))applies, based on the polygon information and the values of ZMINR andZMAXR stored in the ZR-buffer 234, the drawing judgement section 252need only reference the depth information in the ZC-buffer 237. Thismakes it possible to simplify and accelerate the processing. Theconfiguration of this embodiment, in which depth informationcorresponding to at least one region of information in the ZR-buffer 234is stored in the ZC-buffer 237 has more advantages than a simplecombination with memory having a cache function.

4. Third Embodiment

A third embodiment of this invention makes use of the page mode functionof memory such as DRAM, to increase speed. Consider a case in which themain Z-buffer 236 is divided into M×N regions each consisting of 4×4=16pixels, as shown in FIG. 9A. In this case, if the contents of the mainZ-buffer 236 were to be stored in memory such as DRAM with no particularplanning, the data (depth information) would be stored in an addressarray as shown in FIG. 9B. If depth information for a region a is to beread out from depth information that is stored with this address array,it would be necessary to increment the row address sequentially toselect the first row address to read out data items a1 to a4, thenselect the second row address to read out data items a5 to a8, and soon. This obstructs the acceleration of reading from and writing tomemory. This third embodiment of the invention stores the depthinformation in such a manner that, for example, all of the depthinformation for region a is stored at a single first row address in themain Z-buffer 236, the depth information for a region b is stored at asecond row address, and the depth information for a region c is storedat a third row address, as shown in FIG. 9C. Of course, depthinformation for a plurality of regions could be stored at the first rowaddress (for instance, the depth information for regions a, b, and ccould all be stored at the first row address).

The main Z-buffer 236 of this third embodiment is configured of memorysuch as DRAM that has a page mode function. In this page mode, thecolumn address changes in synchronization with a column address strobe(CAS) signal and the row address changes in synchronization with a rowaddress strobe (RAS) signal, as shown in FIG. 9D. Therefore, databelonging to the same row address can be read and written at high speed,simply by switching the CAS signal. In this embodiment, the depthinformation for at least one region is stored at one row address.Therefore, while the depth information for one region is beingreferenced, this depth information can be read and written by simplycontrolling the CAS signal, so that the depth information can be readand written at high speed. The control of this CAS signal is done by thedrawing judgement section 252.

In this manner, the configuration of this embodiment which stores depthinformation corresponding to at least one region of data in theZR-buffer 234 as data at a single row address in the main Z-buffer 236and also makes use of the speed of page mode has more advantages than asimple combination with memory having a page mode function.

It should be noted that this invention is not limited by the abovedescribed first to third embodiments; it can be modified in variousdifferent manners within the scope of the claims thereof.

For example, the description of the above embodiments mainly concerneddrawing processing that was performed for individual polygons, but thepresent invention is not limited thereto; it can equally well be appliedto processing of individual pixels using a scan-line algorithm,irrespective of any polygons.

Similarly, the description of the above embodiments concerned depthinformation that increased with increasing distance from the viewpoint,but the range of this invention can naturally be applied to a case inwhich depth information decreases with increasing distance from theviewpoint. The relationships between ZMIN, ZMAX, ZMINR, and ZMAXR insuch a case are shown in FIGS. 10A to 10C. In this case, the aboveconditions (1), (2), (4), and (5) would be modified as follows:

(1)'When ZMAX≦ZMINR (or ZMAX<ZMINR);

(2)'When ZMIN≧ZMAXR (or ZMIN>ZMAXR);

(4)'When ZPIX<ZMINR (or ZPIX<ZMINR);

(5)'When ZPIX≧ZMAXR (or ZPIX>ZMAXR).

Note that the configurations of the drawing processing section and theimage synthesis section, as well as the overall configuration of theimage synthesis apparatus itself, are not limited to those describedabove in the embodiments, and thus various different configurations canbe employed therefor.

The image synthesis apparatus and image synthesis method of thisinvention can be applied to various different purposes, such as anarcade games machine, a domestic games machine, a flight simulator, or adriving simulator as used in a driving school. The principle of thisinvention is particularly suitable for the algorithms of games programsstored in a games cartridge, a CD-ROM, or a floppy disk used in adomestic games machine or personal computer. It can also be applied to alarge-scale attraction type of game device or simulator in which anumber of players participate.

If this invention is adapted for a games machine, it can be applied tovarious different kinds of games machines, such as those for racing-cargames, combat games, role-playing games, or spaceship games in which a3D map is created.

The computations performed by the image synthesis section and drawingprocessing section in accordance with this invention could equally wellbe performed by a dedicated image synthesis section, drawing processingsection, a general-purpose microprocessor, or by software means using aDSP.

I claim:
 1. An image synthesis apparatus for referencing depthinformation from a main Z-buffer which stores depth information thatexpresses distance from a viewpoint for each of pixels on a displayscreen and for drawing a display object configured by polygons,comprising:a ZR-bluffer for storing a minimum value ZMINR and a maximumvalue ZMAXR of depth information for the pixels within each region ofsaid main Z-buffer, where said main Z-buffer is divided into M×N regionseach formed of K×L pixels; and drawing processing means for omitting aprocess of referencing depth information stored within said mainZ-buffer and a process of drawing a polygon when ZMIN≧ZMAXR orZMIN>ZMAXR, where a minimum value or a value less than said minimumvalue of depth information for pixels within said polygon is ZMIN and amaximum value or a value greater than said maximum value thereof isZMAX, and for performing the process of drawing said polygon withoutreferencing depth information stored within said main Z-buffer whenZMAX≦ZMINR or ZMAX<ZMINR; said drawing processing means comprising pixeldrawing means and drawing judgment means; said pixel drawing meansreceiving polygon information that includes vertex coordinates of thepolygon, drawing the pixels inside the polygon, and outputting referencerequests to said drawing judgment means; and said drawing judgment meansreceiving said polygon information, obtaining ZMIN and ZMAX of thepolygon based on said polygon information, determining a region to whichthe polygon belongs based on said polygon information, reading ZMINR andZMAXR of the determined region from the ZR-buffer, comparing ZMIN withZMAXR and ZMAX with ZMINR, and outputting reference resultscorresponding to said reference requests to said pixel drawing means. 2.The image synthesis apparatus as defined in claim 1; wherein:a minimumvalue or a value less than said minimum value of depth information ofpixels within a part of a polygon which is subdivided along border linesof said regions is set to be said ZMIN, and a maximum value or a valuegreater than said maximum value thereof is set to be said ZMAX.
 3. Theimage synthesis apparatus as defined in claim 1; further comprising:aZC-buffer for storing depth information for at least one of said regionsof said main Z-buffer, said ZC-buffer being a cache memory of the mainZ-buffer; and wherein: when depth information for the region to whichthe polygon belongs is already stored in said ZC-buffer, said drawingprocessing means performs the process of drawing by referencing depthinformation stored in said ZC-buffer, without referencing depthinformation stored in said main Z-buffer.
 4. The image synthesisapparatus as defined in claim 2; further comprising:a ZC-buffer forstoring depth information for at least one of said regions of said mainZ-buffer, said ZC-buffer being a cache memory of the main Z-buffer; andwherein: when depth information for the region to which the polygonbelongs is already stored in said ZC-buffer, said drawing processingmeans performs the process of drawing by referencing depth informationstored in said ZC-buffer, without referencing depth information storedin said main Z-buffer.
 5. The image synthesis apparatus as defined inclaim 1; wherein:said main Z-buffer is configured of memory wherein acolumn address changes in synchronization with a column address strobe(CAS) signal and a row address changes in synchronization with a rowaddress strobe (RAS) signal; and depth information for at least one ofsaid regions is stored in said memory as data at one row address; saiddrawing processing means reading depth information for the region towhich the polygon belongs from said main Z-buffer by only controllingsaid CAS signal.
 6. The image synthesis apparatus as defined in claim 2;wherein:said main Z-buffer is configured of memory wherein a columnaddress changes in synchronization with a column address strobe (CAS)signal and a row address changes in synchronization with a row addressstrobe (RAS) signal; and depth information for at least one of saidregions is stored in said memory as data at one row address; saiddrawing processing means reading depth information for the region towhich the polygon belongs from said main Z-buffer by only controllingsaid CAS signal.
 7. The image synthesis apparatus as defined in claim 1;wherein:when depth information is set to decrease with increasingdistance from said viewpoint, said drawing processing means omits theprocess of referencing depth information stored in said main Z-bufferand the process of drawing when ZMAX≦ZMINR or ZMAX<ZMINR, or whenZPIX≦ZMINR or ZPIX<ZMINR, and performs the process of drawing withoutreferencing depth information stored in said main Z-buffer whenZMIN≧ZMAXR or ZMIN>ZMAXR, or when ZPIX≧ZMAXR or ZPIX>ZMAXR.
 8. The imagesynthesis apparatus as defined in claim 2; wherein:when depthinformation is set to decrease with increasing distance from saidviewpoint, said drawing processing means omits the process ofreferencing depth information stored in said main Z-buffer and theprocess of drawing when ZMAX≦ZMINR or ZMAX<ZMINR, or when ZPIX≦ZMINR orZPIX<ZMINR, and performs the process of drawing without referencingdepth information stored in said main Z-buffer when ZMIN≧ZMAXR orZMIN>ZMAXR, or when ZPIX≧ZMAXR or ZPIX>ZMAXR.
 9. The image synthesisapparatus as defined in claim 3; wherein:when depth information is setto decrease with increasing distance from said viewpoint, said drawingprocessing means omits the process of referencing depth informationstored in said main Z-buffer and the process of drawing when ZMAX≦ZMINRor ZMAX<ZMINR, or when ZPIX≦ZMINR or ZPIX<ZMINR, and performs theprocess of drawing without referencing depth information stored in saidmain Z-buffer when ZMIN≧ZMAXR or ZMIN>ZMAXR, or when ZPIX≧ZMAXR orZPIX>ZMAXR.
 10. The image synthesis apparatus as defined in claim 5;wherein:when depth information is set to decrease with increasingdistance from said viewpoint, said drawing processing means omits theprocess of referencing depth information stored in said main Z-bufferand the process of drawing when ZMAX≦ZMINR or ZMAX<ZMINR, or whenZPIX≦ZMINR or ZPIX<ZMINR, and performs the process of drawing withoutreferencing depth information stored in said main Z-buffer whenZMIN≧ZMAXR or ZMIN>ZMAXR, or when ZPIX≧ZMAXR or ZPIX>ZMAXR.